package com.woniu.atms.controller.pre;

/**
 * @author 张奇
 * @title: PreSeatController
 * @projectName g5_atms
 * @description: TODO 前台座位接口
 * @date 2022/1/24 15:47
 */

import com.woniu.atms.entity.G5CarSeat;
import com.woniu.atms.service.CarSeatService;
import com.woniu.atms.util.Code;
import com.woniu.atms.util.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "前台座位管理")
@RestController
@RequestMapping("/api/pre/v1/seat")
public class PreSeatController {

    @Resource
    private CarSeatService carSeatService;

    /**
     * 根据车辆id查询该车所有座位
     * @param carId
     * @return
     */
    @ApiOperation(value = "根据车辆id查询所有座位",notes = "根据车辆id查询所有座位")
    @RequestMapping("/list/{carId}")
    public ResponseResult<List> seatList(@PathVariable("carId") Integer carId){
        List<G5CarSeat> seats = carSeatService.seatList(carId);
        return new ResponseResult<>(Code.SUCCESS, "查询成功", seats);
    }
}
